-
Notifications
You must be signed in to change notification settings - Fork 764
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial implementation of EngineGetPayloadV2 #4833
Initial implementation of EngineGetPayloadV2 #4833
Conversation
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
...va/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadV2.java
Outdated
Show resolved
Hide resolved
@Override | ||
protected JsonRpcResponse createResponse(final JsonRpcRequestContext request, final Block block) { | ||
return new JsonRpcSuccessResponse( | ||
request.getRequest().getId(), blockResultFactory.enginePayloadTransactionCompleteV2(block)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm hoping we can make a backwards compatible V2 so that the only thing that needs to know about V2 is the very thinnest layer that maps RPC name to class.
Maybe we could pass in an includeBlockValue
or isShanghai
to trigger this behaviour in the shared layer below
...rg/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadTestV2.java
Outdated
Show resolved
Hide resolved
Ported code over from hyperledger#4833 Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
Ported code over from hyperledger#4833 Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
return new EngineGetPayloadResultWithdraws(block.getHeader(), txs, Quantity.create(blockValue)); | ||
} | ||
|
||
private long calculateBlockValue(final List<String> ignored) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea to separate out for later implementation 👍
*/ | ||
package org.hyperledger.besu.ethereum.api.jsonrpc.internal.results; | ||
|
||
public abstract class AbstractEngineGetPayloadResult {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure there's any benefit to having this Abstract class
"executionPayload", | ||
"blockValue", | ||
}) | ||
public class EngineGetPayloadResultWithdraws extends AbstractEngineGetPayloadResult { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably contradicts what I said yesterday, but I'm thinking V2 in the name makes more sense than Withdrawals, although I still don't think V2 should leak further than the API level.
Although this object will end up have Withdrawals in it, including withdrawals could and maybe will be data driven (due to presence of Optional withdrawals).
In this PR, the trigger for this different class structure to be built is really blockValue, but I don't think EngineGetPayloadResultBlockValue makes sense either.
Probably better we keep the code close to the spec in this regard, at least for now until it's clear how the API will evolve with V3
return blockValue; | ||
} | ||
|
||
public static class PayloadResult { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
|
||
import io.vertx.core.Vertx; | ||
|
||
public class EngineGetPayloadV2 extends AbstractEngineGetPayload { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is better than extending EngineGetPayload 👍
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net> Signed-off-by: Justin Florentine <justin+github@florentine.us>
Signed-off-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net> Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
Signed-off-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net>
Signed-off-by: Gabriel Trintinalia gabriel.trintinalia@gmail.com
PR description
Initial implementation of EngineGetPayloadV2
Fixed Issue(s)
See ethereum/execution-apis#307
Documentation
doc-change-required
label to this PR ifupdates are required.
Changelog